
###############################################################################
#  PROJECT_ALL_DIR        - store all directories under the project
#                           used by the find<package>.cmake modules
#  PROJECT_ALL_LIB_DIR    - store all directories under the project
#                           which stores the built libraries
#

# - Try to find OpenSceneGraph
# Once done this will define following variables
#  
#  OPENSCENEGRAPH_FOUND        - system has OpenSceneGraph
#  OPENSCENEGRAPH_INCLUDE_DIRS - the OpenSceneGraph include directory
#  OPENSCENEGRAPH_LIBRARY_DIRS - the OpenSceneGraph library directory
#  OPENSCENEGRAPH_LIBRARIES    - Link these to use OpenSceneGraph
#

SET( OPENSCENEGRAPH_FOUND "YES" )
SET( OPENSCENEGRAPH_INCLUDE_DIRS )
SET( OPENSCENEGRAPH_LIBRARY_DIRS )
SET( OPENSCENEGRAPH_LIBRARIES )

FIND_PATH( OPENSCENEGRAPH_INCLUDE_DIRS osg/Config
    /usr/local/include
)

FIND_LIBRARY( OPENSCENEGRAPH_osg_LIBRARY
    NAMES osg
    PATHS /usr/local/lib/dbg/
          /usr/local/lib/opt/
)
FIND_LIBRARY( OPENSCENEGRAPH_viewer_LIBRARY
    NAMES osgViewer
    PATHS /usr/local/lib/dbg/
          /usr/local/lib/opt/
)
FIND_LIBRARY( OPENSCENEGRAPH_util_LIBRARY
    NAMES osgUtil
    PATHS /usr/local/lib/dbg/
          /usr/local/lib/opt/
)
FIND_LIBRARY( OPENSCENEGRAPH_DB_LIBRARY
    NAMES osgDB
    PATHS /usr/local/lib/dbg/
          /usr/local/lib/opt/
)

SET( OPENSCENEGRAPH_LIBRARIES 
    ${OPENSCENEGRAPH_osg_LIBRARY}
    ${OPENSCENEGRAPH_viewer_LIBRARY}
    ${OPENSCENEGRAPH_util_LIBRARY}
    ${OPENSCENEGRAPH_DB_LIBRARY}
)

# verbose
IF( BUILD_VERBOSE )
    MESSAGE( STATUS 
        "----verbose: OPENSCENEGRAPH_INCLUDE_DIRS: 
        ${OPENSCENEGRAPH_INCLUDE_DIRS}" )
    MESSAGE( STATUS 
        "----verbose: OPENSCENEGRAPH_LIBRARY_DIRS: 
        ${OPENSCENEGRAPH_LIBRARY_DIRS}" )
    MESSAGE( STATUS 
        "----verbose: OPENSCENEGRAPH_LIBRARIES:
        ${OPENSCENEGRAPH_LIBRARIES}" )
ENDIF( BUILD_VERBOSE )

